
#ifndef __CORTISOL_AVLIB_H
#define __CORTISOL_AVLIB_H

class AVLib
{

	static AVCodecLib  *avcodec;
	static AVFormatLib *avformat;
	static AVUtilLib   *avutil;
	static SWScaleLib   *swscale;

	AVLib() {

	}

	virtual ~AVLib() {

	}

public:

	static const AVCodecLib* Codec() {

		if(!avcodec)
			avcodec = new AVCodecLib();

		return avcodec;
	}

	static const AVFormatLib* Format() {

		if(!avformat)
			avformat = new AVFormatLib();

		return avformat;
	}

	static const AVUtilLib* Util() {

		if(!avutil)
			avutil = new AVUtilLib();

		return avutil;
	}

	static const SWScaleLib* SWScale() {

		if(!swscale)
			swscale = new SWScaleLib();

		return swscale;
	}
};

#endif /*** __CORTISOL_AVLIB_H ***/

